
#include "stdafx.h"
#include "Packet.h"
#include "BinaryFactory.h"


BinaryFactory::BinaryFactory()
{
	m_pBinaryPool		= new CMemoryPoolFactory<Binary>;

}

BinaryFactory::~BinaryFactory()
{
	delete m_pBinaryPool;
}

VOID BinaryFactory::Release()
{
	m_pBinaryPool->Release();
}

VOID BinaryFactory::Init( DWORD dwSize )
{
	m_pBinaryPool->Initialize( dwSize, dwSize/2+1 );
}

Binary* BinaryFactory::Alloc()
{
	Binary *pBinary = m_pBinaryPool->Alloc();
	//init
	return pBinary;
}

VOID BinaryFactory::Free( Binary* pBinary )
{
	m_pBinaryPool->Free(pBinary);
}

